package de.cbf.cam.dsa.facet.armor.act;

import de.cbf.cam.dsa.facet.armor.service.IServiceResolver_FacetArmor;
import de.cbf.cam.dsa.facet.armor.service.ServiceResolver_FacetArmor;
import de.cbf.cam.dsa.facet.armor.service.persister_interface.IServicePersister_FacetArmor;
import de.cbf.util.entity.facet.persistence.interfaces.IServPersister;
import de.cbf.util.entity.facet.persistence.resolver.IServiceResolverElement;
import de.cbf.util.entity.facet.persistence.resolver.act.AbstractActivatorResolverElement;
import de.cbf.util.entity.facet.persistence.resolver.act.AbstractActivatorResolverFacet;

/**
 * The activator class controls the plug-in life cycle
 */
public class ActivatorFacetArmor  extends AbstractActivatorResolverFacet {

	// The plug-in ID
	public static final String PLUGIN_ID = "de.cbf.cam.dsa.facet.armor"; //$NON-NLS-1$

	// The shared instance
	private static ActivatorFacetArmor plugin;
	
	/**
	 * The constructor
	 */
	public ActivatorFacetArmor() {
	}
	
	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static ActivatorFacetArmor getDefault() {
		return plugin;
	}

	@Override
	protected IServiceResolverElement createResolverService() {
		return new ServiceResolver_FacetArmor();
	}

	@Override
	protected Class<? extends IServPersister> getServPersisterInterface() {
		return IServicePersister_FacetArmor.class;
	}

	@Override
	protected String[] getServiceResolverInterfacesNames() {
		return new String[]{IServiceResolver_FacetArmor.class.getName()};
	}

	@Override
	protected void setPluginInstance(
			AbstractActivatorResolverElement newActivatorInstance) {
		if (newActivatorInstance instanceof ActivatorFacetArmor) {
			ActivatorFacetArmor activatorFacet = (ActivatorFacetArmor) newActivatorInstance;
			plugin = activatorFacet;
		}	
	}
	
	@Override
	protected String getPlugin_ID() {		
		return PLUGIN_ID;
	}
}
